package com.hardroid.workload.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import com.hardroid.workload.R;
import com.hardroid.workload.ui.fragment.UnitKerjaFragment;

public class UnitKerjaActivity extends Activity {

	
	public UnitKerjaFragment unitFragment;
	public Button addNewUnit;
//	public Button observeUnit;

	@Override
	protected void onCreate(Bundle arg0) {
		// TODO Auto-generated method stub
		super.onCreate(arg0);
		setContentView(R.layout.activity_unit_kerja);

		Log.i("Unit Kerja Acitivy", "onCreATE");

		 unitFragment = (UnitKerjaFragment) getFragmentManager()
		 .findFragmentById(R.id.fragment_unit);

		addNewUnit = (Button) findViewById(R.id.unit_kerja_add_button);
		addNewUnit.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				startActivity(new Intent(getBaseContext(),
						NewUnitActivity.class));
			}
		});
		
//		observeUnit= (Button) findViewById(R.id.unit_kerja_observe_button);
//		observeUnit.setOnClickListener(new View.OnClickListener() {
//
//			@Override
//			public void onClick(View v) {
//				// TODO Auto-generated method stub				
//				unitFragment.openQuestionaire();
//			}
//		});
	}

	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
//		Singleton.saveProject(Singleton.currentProject);
	}

}
